<?php

namespace App\Admin\Models;

use Illuminate\Database\Eloquent\SoftDeletes;

class AdminOperationLog extends Model
{
    use SoftDeletes;

    protected $guarded = []; 

    public $casts = [
        'id' => 'string',
        'user_id' => 'string',
        'path' => 'string',
        'method' => 'string',
        'ip' => 'string',
        'input' => \App\Admin\Casts\Json::class,
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s',
        'deleted_at' => 'datetime:Y-m-d H:i:s',
    ];

    public function adminUser()
    {
        return $this->belongsTo(
            AdminUser::class,
            'user_id',
            'id'
        );
    }
}